home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1996 #15
/
Monster Media Number 15 (Monster Media)(July 1996).ISO
/
prog_c
/
cuj0696.zip
/
DWYER.ZIP
/
SERIAL.TST
/
README.SRL
< prev
next >
Wrap
Text File
|
1995-12-27
|
4KB
|
120 lines
DESCRIPTION OF THE SERIAL TEST
Introduction
------------
The serial test is a lot like the frequency test. The similarity
is that all pairs occur with the same probability. The difference
is that you grind out independent PAIRS of random numbers to see
how uniformly the pairs are distributed. The probability of an
occurrence of a pair of integers (q,r) in a collection of pairs,
where 0 <= q,r < d, is 1/d^2. The number of times that each pair
occurs is counted and a chi-square test is performed when the
count is complete. The number of pairs to be counted must be
at least 5 * d^2 (the program will insist on it).
The serial test is implemented as program serltst. This program
performs a Kolmogorov-Smirnov analysis on probabilities from 100
chi-square tests. The parameters that determine how the chi-square
tests are performed are specified by the user. These parameters
are read from the console unless the input device is redirected.
As usual, prompts and messages are written to stderr and results
are written to stdout.
Running the Serial Test
-----------------------
To start program serltst, you can say simply
serltst
and you will be prompted for the required inputs.
Alternatively, you can say
serltst < [myserl.inp]
and the program will take its input data from myserl.inp.
Five parameters will be requested by program serltst:
1. Seed for the random number generator (-1 = Time of day).
If you do not specify -1, the value entered must be less
than 65536.
2. Selection of generator to be tested.
If you are working interactively, you will see a list
of the generators that can be selected. You enter the
character that represents your generator. If you enter
a character that is not in the list, the library rand()
function will be used.
3. Size of data set.
You can specify any number between 10 (a lower limit set in
the program) and 181 which is the nearest integer less than
the square root if 32768.
Independent pairs of random integers between 0 and one less
than the number that you specify here will be generated.
4. Minimum cell expectation.
A cell is the same as a category and a category is represented
by an independent pair of random numbers. The number entered
here sets the minimum number of random pairs that you can specify
in the next input. The minimum number of pairs is
M = S * S * E
where S is specified at step 3 and E is specified here.
5. Number of pairs of random numbers to be generated.
If you do not enter a number less than the minimum number
dictated by parameter 4, the minimum number will be used.
The program will tell you that your entry has been clamped
if this happens.
Once the input parameters are out of the way, the program will execute
100 chi-square runs as dictated by the input:
1. The generator of choice is called 2*M times and the cell
(or category) corresponding to the integer pair is tallied.
2. A chi-square statistic is calculated for the array of tallies.
3. A probability for the chi-square statistic is calculated.
4. The probability is stored.
5. A running account of the steps and the number of variates
generated lets you know that the program is executing.
When the 100 runs are complete, a Kolmogorov-Smirnov test is run on
the array to obtain statistics Kn+ and Kn- and their corresponding
probabilities.
Final printouts consist of the Kolmogorov-Smirnov statistics and
probabilities and the number of random numbers generated during the
test.
Figure.1s shows a sample file should you elect to redirect the input.
Figure.2s shows what you can expect to see if you let all outputs run
to your console. Figure.3s shows the results of a run made from the
inputs shown in Figure.1s.
Timing Estimates
----------------
The run shown in figure.1p required about 1.8 seconds on my
Pentium 100. Naturally, the time required depends on the
generator (and the CPU). For the data shown, the range of
times is from 1.8 seconds for the MSC library function rand()
to 8.8 seconds for the generator by Stephen L. Moshier.
Both tests required exactly 1,000,000 random numbers.